
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void test(char *i)//错误的代码
{
    i = malloc(sizeof(char) * 100);
}
int main()
{
    char *p = NULL;
    test(p);

    strcpy(p, "hello");

    printf("%s\n", p);
    free(p);

    return 0;
}

